#include<bits/stdc++.h>

using namespace std;

int main() {
    int a[] = {1, 2, 2, 2, 2, 3, 4, 5, 6, 7, 7};
    int n = sizeof(a) / sizeof(a[0]);
    int k = 12;
    cout << (find(a, a + n, k) != a + n) << endl;//O(n)
    cout << (count(a, a + n, k)) << endl;//O(n)
    cout << (binary_search(a, a + n, k)) << endl;//O(log(n))
    cout << (lower_bound(a, a + n, k)-a) << endl;//O(log(n))
    cout << (upper_bound(a, a + n, k)-a) << endl;//O(log(n))
}